<?php
require_once "_utils/get_info.php";

if (!isset($_GET["id"])) {
	require "header.php";
	echo "<img class='screenshot_right' src='_images/full_scrn_small.png' />
		<div id='description_block'>
		<h4>What is the Movie Data Analyzer?</h4>
		Most web sites containing information about movies tend to focus on the data
		itself, providing lists of what an actor has been in, what a director has directed, biographies, etc.  
		The theme of <em>this</em> site, however, is to analyze such common data listed on those other sites so
		that we can better present the data for, and draw interesting correlations between, the people in
		question.  <br /><br />Much of the data we display is information that is not readily apparent or possible to be found
		on such other sites.  We show this information through visualizations and summarizations so that the data can
		be viewed quickly.
		</div>
		<div class='clearer'></div>
		<img class='screenshot_left' src='_images/cascade.png' />
		<div class='description_text'>
		<h4>With the <strong>Movie Data Analyzer</strong>, you can search for a person and find:</h4>
			<ul>	
				<li>the number of that person's <strong>projects per year</strong></li>
				<li>the <strong>average critical rating</strong> that person has received each year</li>
				<li>the <strong>top genres</strong> that person has worked in by year and by career</li>
				<li>a list of <strong>top collaborators</strong> that the person has worked well with throughout his/her career</li>
			</ul>
		</div>
		<div class='clearer'></div>
			";
} else {
	$id = $_GET["id"];
	$res = getBioInfo($id);
	if (empty($res['name'])) {
		preg_match('@(/.*?omicron8)@', $_SERVER['REQUEST_URI'], $matches);
		header('Location: '.$matches[1]);
	}
	$pageTitle = $res["name"];
	$charts = getBasicCharts($id);
	$genres = getGenreCharts($id, 3);
	require "header.php";
	echo "
	<div class='widget_box_full'>
   	<div class='title_box_bar light_blue'>General Information</div>
      	<img id='person_picture' src='" . $res["imgloc"] . "' />
     	 <div id='person_info'>
     	 	<div id='person_name'>" . $res["name"] . "</div>
     	 	<div class='gen_person_info'>$res[bdate] - ".(empty($res['ddate']) ? '' : "$res[ddate]")."</div>
      	<div class='gen_person_info'><span class='info_category'>Age:</span>" . $res["age"] . "</div>
         <div class='gen_person_info'><span class='info_category'>Roles:</span>" . $res["roles"] . "</div>
         <div class='gen_person_info'><span class='info_category'>Average Reception:</span>" . $res["avgrank"] . "/10</div>
      </div>
      <div id='imdb_link'><a href='http://imdb.com/find?s=all&q=". $res["name"] ."'>More Information</a></div>	
	</div>
	<div class='clearer'></div>

	<div class='widget_box_half left'>
   	<div class='title_box_bar light_orange'>Movies per Year</div>
   	<img class='graph_picture' src='" . $charts["career"] . "' />
	</div>
	<div class='widget_box_half right'>
   	<div class='title_box_bar light_green'>Yearly Reception</div>
   	<img class='graph_picture' src='" . $charts["reception"] . "' />
	</div>
	<div class='widget_box_tq left'>
   	<div class='title_box_bar light_blue'>Top Genres</div>
   	<img class='graph_pie' src='" . $genres['pie'] . "' />
	</div>
	<div class='widget_box_oq right'>
   	<div class='title_box_bar light_pink'>Top Collaborators</div>
		<div class='person_list'>" . getTopCollaborators($id)
		. "</div>
	</div>
	<div class='widget_box_full'>
   	<div class='title_box_bar light_purple'>Yearly Top Genres</div>
   		<img class='graph_picture_full' src='". $genres['line'] . "' />
	</div>
	<div class='clearer'></div>
	";
}
include "footer.php";
?>
